﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true"
    CodeBehind="ManagerMain.aspx.cs" Inherits="RN.ERP.Web.ManagerMain" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript">
        var systemID = '<%=SystemID %>';
        $(function () {
            if (systemID == 97)
                $('#zhuguan').hide(); //edit by dyg
        });

        function CheckSel() {
            var chk = $("input:checked");
            if (chk.length == 0) {
                $.ligerDialog.warn("请选择要查看的企业！");
                return false;
            }
            if (chk.length > 1) {
                $.ligerDialog.warn("请选择一家企业进行查看！");
                return false;
            }
            var guid = chk.attr("value").split(';')[0];

            window.location.href = '../Enterprise/EnterpriseCorpInfo.aspx?corpUserGuid=' + guid;
        }
        function GetCheckVal() {
            var postModel = [];
            $("input:checked").each(function () {
                postModel.push({ name: 'data', value: $(this).val() });
            });
            return postModel;
        }
        function AuditLocalCorp(opt) {
            var chk = $("input:checked");
            if (chk.length == 0) {
                $.ligerDialog.warn("请选择要审核的企业！");
                return false;
            }
            if (chk.length > 1) {
                $.ligerDialog.warn("请选择一家企业进行审核！");
                return false;
            }
            radconfirm('确定审核该企业信息？', Post, 300, 150, null, '提示');
            return false;
            function Post(arg) {
                if (arg) {
                    var guid = chk.attr("value").split(';')[0];
                    $.getJSON("../Handlers/EnterpriseCorpInfoHandler.ashx", { "action": "AuditCorp", "data": guid, "opt": opt, "content": "", "rand": Math.random() }, function (data) {
                        $.ligerDialog.warn(data.Message);
                        refreshLocalCorpGrid();
                    }
            );
                }
            }
        }

        function AuditEmbranchCorp(opt) {
            var chk = $("input:checked");
            if (chk.length == 0) {
                $.ligerDialog.warn("请选择要审核的企业！");
                return false;
            }
            if (chk.length > 1) {
                $.ligerDialog.warn("请选择一家企业进行审核！");
                return false;
            }
            radconfirm('确定审核该企业信息？', Post, 300, 150, null, '提示');
            return false;
            function Post(arg) {
                if (arg) {
                    var guid = chk.attr("value").split(';')[0];
                    $.getJSON("../Handlers/EnterpriseCorpInfoHandler.ashx", { "action": "AuditCorp", "data": guid, "opt": opt, "content": "", "rand": Math.random() }, function (data) {
                        $.ligerDialog.warn(data.Message);
                        refreshEmbranchCorpGrid();
                    }
            );
                }
            }
        }

        function confirmCallBackFnPost(arg) {
            if (arg) {
                var postModel = GetCheckVal();
                var roleid = "<%=RoleId %>";
                postModel.push({ name: 'action', value: "AuditCorp" });
                postModel.push({ name: 'roleid', value: roleid });
                postModel.push({ name: 'rand', value: Math.random() });
                $.ajax({
                    async: false,
                    url: '../Handlers/EnterpriseCorpInfoHandler.ashx',
                    data: postModel,
                    type: 'post',
                    cache: false,
                    success: function (ret) {
                        if (ret.Status == 0) {
                            $.ligerDialog.success('审核成功');
                            window.location.reload();
                        }
                        else {
                            $.ligerDialog.warn(ret.Message);
                        }
                    },
                    error: function (index, ret, msg) {
                        $.ligerDialog.error(msg);
                    }
                });
            }
        }
        function ShowCorpView(corpGuid) {
            top.ChildDialog = top.$.ligerDialog.open({ url: "Enterprise/EnterpriseCorpInfo.aspx?corpUserGuid=" + corpGuid, width: 1180, height: 800, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            top.setChildDialogClose(this, "Refresh");
            //  window.location.href = '../Enterprise/EnterpriseCorpInfo.aspx?corpUserGuid=' + guid;
        }
        function Refresh(type) {
            ////刷新最上方的工具栏
            //        alert('123');
            //        var mainFrame = parent.$("#userInfoTop").attr('src');
            //        alert(mainFrame);
            //        alert('456');
            var tabs = top.tab.getTabidList("", "");
            for (var i = 0; i < tabs.length; i++) {
                top.tab.reload(tabs[i]);
            }
            if (type != null && type != "" && type == "Add") {
                //window.location.href = "../Enterprise/EnterpriseCorpInfo.aspx";
                top.tab.addTabItem({ tabid: new Date().getTime(), text: "企业信息管理", url: "Enterprise/EnterpriseCorpInfo.aspx" });
            }

        }
        function refreshLocalCorpGrid() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("LocalCorp");
        }
        function refreshEmbranchCorpGrid() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("EmbranchCorp");
        }
        function refreshShowLoading(objId) {
            $("#gridLoading").show();
        }
        function refreshHideLoading(objId) {
            $("#gridLoading").hide();
        } 
    </script>
    <script type="text/javascript">

        function CheckPersonSel() {
            var chk = $("input:checked", $("#personEmp"));
            if (chk.length == 0) {
                $.ligerDialog.warn("请选择要修改的项！");
                return false;
            }
            return true;
        }
        function GetCheckPersonVal() {
            var empGuid = "";
            $("input:checked", $("#personEmp")).each(function () {
                empGuid += "," + $(this).val();
            });
            if (empGuid.length > 1) {
                empGuid = empGuid.substring(1);
            }
            return empGuid;
        }

        /*人员审核退回*/
        var optType = 5;
        var optTypeStr = "主管审核";
        function CheckPersonAudit(opt) {
            if (!CheckPersonSel()) {
                return false;
            }
            optType = opt;
            var massage = '请确定要审核人员信息？';
            if (optType == 6) {
                optTypeStr = "主管退回";
                massage = '请确定要退回人员信息？';
            }
            radconfirm(massage, confirmCallBackFnPersonAudit, 300, 150, null, '提示');
            return false;
        }
        function confirmCallBackFnPersonAudit(arg) {
            if (arg) {
                var empGuid = GetCheckPersonVal();
                var corpGuid = "<%=CorpUserGuid %>";
                var areaCode = "<%=AreaCode %>";
                if (empGuid == "") {
                    $.ligerDialog.warn("请选择要修改的项！");
                    return false;
                }
                var parmer = {};
                parmer.action = "EmpPost";
                parmer.empGuid = empGuid;
                parmer.corpGuid = corpGuid;
                parmer.areaCode = areaCode;
                parmer.message = optTypeStr;
                parmer.optType = optType;
                parmer.descr = "";
                parmer.rand = Math.random();
                $.getJSON("../Handlers/PsnEmpInfoHandler.ashx", parmer, function (data) {
                    OpenAlertPerson(data.Message);
                    refreshPersonGrid();
                });
            }
        }
        /*查看人员*/
        function CheckPersonView() {
            if (!CheckPersonSel()) {
                return false;
            }
            var chk = $("input:checked", $("#personEmp"));
            if (chk.length > 1) {
                $.ligerDialog.warn("只能选择一项！");
                return false;
            }
            var empGuid = GetCheckPersonVal();
            ShowViewPerson(empGuid, 1);

        }

        /*刷新*/
        function refreshPersonGrid() {
            $find("<%= RadAjaxManager1.ClientID%>").ajaxRequest("Person");
        }
        function OpenAlertPerson(text) {
            $.ligerDialog.warn(text);
            return false;
        }
        /*打开窗口*/
        function ShowViewPerson(empGuid1, opt) {
            //window.radopen("../Person/PersonEmpView.aspx?empGuid=" + empGuid1 + "&typeFlag=-1&opt=" + opt, "UserDialog");
            top.ChildDialog = top.$.ligerDialog.open({ url: "Person/PersonEmpView.aspx?empGuid=" + empGuid1 + "&typeFlag=-1&opt=" + opt, width: 1080, height: 800, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            top.setChildDialogClose(this, "OnClientCloseAudit");
            return false;
        }
        function OnClientClosePerson(oWnd, args) {
            var arg = args.get_argument();
            if (arg) {
                if (arg.Result == 1) {
                    refreshPersonGrid();
                }
            }
        }
        function OnClientCloseAudit(args) {
            if (args == 1) {
                refreshPersonGrid();
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rdgLocalCorps" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rglEmbranchMents" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgPersonList" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        <ClientEvents OnRequestStart="refreshShowLoading" OnResponseEnd="refreshHideLoading" />
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="1120" valign="top">
                <div class="user_li" id="zhuguan">
                    <div class="useLi">
                    </div>
                    <div class="useL">
                        <h3>
                            主管:<asp:Literal ID="ltrLoginUser" runat="server"></asp:Literal></h3>
                        <span><strong>用户名称：</strong><asp:Literal runat="server" ID="ltrUserName"></asp:Literal></span>&nbsp;&nbsp;&nbsp;&nbsp;
                    </div>
                    <div class="useR">
                    </div>
                </div>
            </td>
            <%--<td width="80%" valign="top">--%>
            <div class="right">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom: 10px;
                    table-layout: fixed;">
                    <tr>
                        <td class="xx_m  tt_xx_l">
                        </td>
                        <td class="xx_m  tt_xx_icon">
                        </td>
                        <td style="width: auto;" class="xx_m">
                            待办事项
                        </td>
                        <td style="width: 14px;">
                            <img src="../images/xx_r.jpg" width="14" height="33" />
                        </td>
                    </tr>
                    <tr>
                        <td class="left_con">
                        </td>
                        <td colspan="2">
                            <div id="con">
                                <ul id="tags">
                                    <li class="selectTag"><a onclick="selectTag('tagContent0',this)" href="javascript:void(0)">
                                        本地企业审核</a> </li>
                                    <li><a onclick="selectTag('tagContent1',this)" href="javascript:void(0)">外地企业审核</a>
                                    </li>
                                    <%--<li><a onclick="selectTag('tagContent2',this)" href="javascript:void(0)">企业业绩审核</a>
                                    </li>--%>
                                    <li><a onclick="selectTag('tagContent3',this)" href="javascript:void(0)">人员审核</a>
                                    </li>
                                </ul>
                                <div id="tagContent">
                                    <div style="text-align: center;">
                                        <img id="gridLoading" src="../Scripts/ligerUI/skins/Aqua/images/common/bigloading.gif"
                                            style="display: none;" /></div>
                                    <div class="tagContent selectTag" id="tagContent0">
                                        <div style="clear: both; width: 99%;">
                                            <div class="i-con-cn">
                                                <input type="button" class="xtbiao" onclick="AuditLocalCorp(6)" value="退回企业" />
                                                <input type="button" class="xtbiao" onclick="AuditLocalCorp(5)" value="审核企业" />
                                            </div>
                                        </div>
                                        <div style="clear: both; width: 99%;">
                                            <telerik:RadGrid ID="rdgLocalCorps" runat="server" AutoGenerateColumns="False" CellSpacing="0"
                                                OnNeedDataSource="rdgLocalCorps_NeedDataSource" Culture="zh-CN" GridLines="None"
                                                AllowFilteringByColumn="false" AllowPaging="true" AllowCustomPaging="true" AllowMultiRowSelection="true"
                                                AllowSorting="false" ShowStatusBar="true">
                                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID">
                                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                                                    </RowIndicatorColumn>
                                                    <Columns>
                                                        <telerik:GridTemplateColumn HeaderText="选择" HeaderStyle-Width="50px">
                                                            <ItemTemplate>
                                                                <input id="ckb" type="checkbox" value='<%#Eval("CorpUserGuid")+";"+Eval("Type")%>'
                                                                    runat="server" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="50px"></ItemStyle>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="ID" HeaderText="ID" UniqueName="ID" ReadOnly="true"
                                                            Visible="false">
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="CorpName" HeaderText="企业名称">
                                                            <ItemTemplate>
                                                                <a href="javascript:void(0);" onclick="ShowCorpView('<%#Eval("CorpUserGuid") %>')"
                                                                    title="点击查看企业信息"><span style="color: #43a9f5">
                                                                        <%#Eval("CorpName")%></span></a>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="Address" HeaderText="企业地址">
                                                            <ItemTemplate>
                                                                <%#Eval("Address") == null ? "" : (Eval("Address").ToString().Length<15?Eval("Address").ToString():Eval("Address").ToString().Substring(0, 15))%>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn HeaderText="企业类型">
                                                            <ItemTemplate>
                                                                <%#Eval("RoleId") == null ? "" : GetCorpClassKind(Eval("RoleId").ToString())%>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="DetailName" HeaderText="主项资质">
                                                            <ItemTemplate>
                                                                <%#Eval("DetailName") == null ? "" : (Eval("DetailName").ToString() + "-" + Eval("GradeName").ToString())%>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="FlowCode" HeaderText="审核状态" ItemStyle-Width="100px">
                                                            <ItemTemplate>
                                                                <%#Eval("StrFlowCode")%>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </Columns>
                                                </MasterTableView>
                                                <ClientSettings EnableRowHoverStyle="true">
                                                </ClientSettings>
                                                <PagerStyle AlwaysVisible="True" />
                                                <FilterMenu EnableImageSprites="False">
                                                </FilterMenu>
                                            </telerik:RadGrid>
                                        </div>
                                    </div>
                                    <div class="tagContent" id="tagContent1">
                                        <div style="clear: both; width: 99%;">
                                            <div class="i-con-cn">
                                                <input type="button" class="xtbiao" onclick="AuditEmbranchCorp(6)" value="退回企业" />
                                                <input type="button" class="xtbiao" onclick="AuditEmbranchCorp(5)" value="审核企业" />
                                            </div>
                                        </div>
                                        <div style="clear: both; width: 99%;">
                                            <telerik:RadGrid ID="rglEmbranchMents" runat="server" AutoGenerateColumns="False"
                                                OnNeedDataSource="rglEmbranchMents_NeedDataSource" CellSpacing="0" Culture="zh-CN"
                                                GridLines="None" AllowFilteringByColumn="false" AllowPaging="true" AllowCustomPaging="true"
                                                AllowMultiRowSelection="true" AllowSorting="false" ShowStatusBar="true">
                                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID">
                                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                                                    </RowIndicatorColumn>
                                                    <Columns>
                                                        <telerik:GridTemplateColumn HeaderText="选择" HeaderStyle-Width="50px">
                                                            <ItemTemplate>
                                                                <input id="ckb" type="checkbox" value='<%#Eval("CorpUserGuid")+";"+Eval("Type")%>'
                                                                    runat="server" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="50px"></ItemStyle>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="ID" HeaderText="ID" UniqueName="ID" ReadOnly="true"
                                                            Visible="false">
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="CorpName" HeaderText="企业名称">
                                                            <ItemTemplate>
                                                                <a href="javascript:void(0);" onclick="ShowCorpView('<%#Eval("CorpUserGuid") %>')"
                                                                    title="点击查看企业信息"><span style="color: #43a9f5">
                                                                        <%#Eval("CorpName")%></span></a>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="Address" HeaderText="企业地址">
                                                            <ItemTemplate>
                                                                <%#Eval("Address") == null ? "" : (Eval("Address").ToString().Length<15?Eval("Address").ToString():Eval("Address").ToString().Substring(0, 15))%>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="CorpType" HeaderText="企业类型">
                                                            <ItemTemplate>
                                                                <%#Eval("Type")==null?"":GetCorpClassKind(Eval("Type").ToString())%>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="DetailName" HeaderText="主项资质">
                                                            <ItemTemplate>
                                                                <%#Eval("DetailName") == null ? "" : (Eval("DetailName").ToString() + "-" + Eval("GradeName").ToString())%>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn DataField="FlowCode" HeaderText="审核状态" ItemStyle-Width="100px">
                                                            <ItemTemplate>
                                                                <%#Eval("StrFlowCode")%>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </Columns>
                                                </MasterTableView>
                                                <ClientSettings EnableRowHoverStyle="true">
                                                </ClientSettings>
                                                <PagerStyle AlwaysVisible="True" />
                                                <FilterMenu EnableImageSprites="False">
                                                </FilterMenu>
                                            </telerik:RadGrid>
                                        </div>
                                    </div>
                                    <div class="tagContent" id="tagContent2">
                                        第三个标签的内容</div>
                                    <div class="tagContent" id="tagContent3">
                                        <div style="clear: both; width: 99%;">
                                            <div class="i-con-cn">
                                                <input type="button" class="xtbiao" onclick="CheckPersonAudit(6)" value="退回人员" />
                                                <input type="button" class="xtbiao" onclick="CheckPersonAudit(5)" value="审核人员" />
                                            </div>
                                        </div>
                                        <div style="clear: both; width: 99%;" id="personEmp">
                                            <telerik:RadGrid ID="rgPersonList" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                                                AllowCustomPaging="True" AllowMultiRowSelection="true" OnNeedDataSource="rgPersonList_NeedDataSource"
                                                AllowFilteringByColumn="false" AllowSorting="True" PageSize="10" ShowStatusBar="True"
                                                CellSpacing="0" Culture="zh-CN" GridLines="None">
                                                <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" EnableRowHoverStyle="true">
                                                    <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
                                                        AllowColumnResize="True"></Resizing>
                                                </ClientSettings>
                                                <MasterTableView AutoGenerateColumns="False" NoMasterRecordsText="暂无数据">
                                                    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                                                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                                    </RowIndicatorColumn>
                                                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                                    </ExpandCollapseColumn>
                                                    <Columns>
                                                        <telerik:GridTemplateColumn HeaderText="选择" HeaderStyle-Width="50px">
                                                            <ItemTemplate>
                                                                <input id="ckb" type="checkbox" value='<%#Eval("EmpGuid") %>' runat="server" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="50px"></ItemStyle>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn DataField="EmpGuid" DataType="System.String" HeaderText="EmpGuid"
                                                            UniqueName="EmpGuid" Visible="false">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="corpName" DataType="System.String" HeaderText="企业名称"
                                                            SortExpression="corpName">
                                                            <ItemStyle Width="200px"></ItemStyle>
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn HeaderText="姓名">
                                                            <ItemTemplate>
                                                                <a href="javascript:void(0);" onclick="ShowViewPerson('<%#Eval("EmpGuid") %>',1)"
                                                                    title="点击查看人员信息"><span style="color: #43a9f5">
                                                                        <%#Eval("Name") %></span></a>
                                                            </ItemTemplate>
                                                            <ItemStyle Width="80px"></ItemStyle>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridCalculatedColumn SortExpression="IDType" HeaderText="证件类型" DataFields="IDType"
                                                            Expression='{0}=="1"?"身份证":"其他"' FooterText="CalculatedColumn footer">
                                                            <ItemStyle Width="60px"></ItemStyle>
                                                        </telerik:GridCalculatedColumn>
                                                        <telerik:GridBoundColumn DataField="IDCard" DataType="System.String" HeaderText="证件号"
                                                            SortExpression="IDCard" UniqueName="IDCard">
                                                            <ItemStyle Width="130px"></ItemStyle>
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="StrFlowCode" DataType="System.String" HeaderText="审核状态"
                                                            SortExpression="StrFlowCode">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="TypeFlag" DataType="System.String" Visible="false">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                </MasterTableView>
                                                <PagerStyle AlwaysVisible="True" />
                                                <FilterMenu EnableImageSprites="False">
                                                </FilterMenu>
                                            </telerik:RadGrid>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <script type="text/javascript">
                                function selectTag(showContent, selfObj) {
                                    // 操作标签
                                    var tag = document.getElementById("tags").getElementsByTagName("li");
                                    var taglength = tag.length;
                                    for (i = 0; i < taglength; i++) {
                                        tag[i].className = "";
                                    }
                                    selfObj.parentNode.className = "selectTag";
                                    // 操作内容
                                    for (i = 0; j = document.getElementById("tagContent" + i); i++) {
                                        j.style.display = "none";
                                    }
                                    document.getElementById(showContent).style.display = "block";
                                    ////动态加载内容中的列表
                                    $("#ContentPlaceHolder1_hdnSelectTagName").val(showContent);
                                    if (showContent == "tagContent0") {
                                        refreshLocalCorpGrid();
                                    }
                                    if (showContent == "tagContent1") {
                                        refreshEmbranchCorpGrid();
                                    }
                                    if (showContent == "tagContent3") {
                                        refreshPersonGrid();
                                    }
                                }
                            </script>
                        </td>
                        <td class="right_con">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="con_m tt_left_bottom">
                            &nbsp;
                        </td>
                        <td colspan="2" class="con_m">
                            &nbsp;
                        </td>
                        <td class="tt_right_bottom">
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="51%" style="vertical-align: top;">
                            <table width="99%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td style="width: 19px" class="xx_m">
                                        <img src="../images/xx_l.jpg" width="19" height="33" />
                                    </td>
                                    <td style="width: 31px" class="xx_m">
                                        <img src="../images/xx.jpg" width="24" height="33" />
                                    </td>
                                    <td style="width: auto" class="xx_m">
                                        信息互递
                                    </td>
                                    <td style="width: 19px">
                                        <img src="../images/xx_r.jpg" width="14" height="33" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="left_con">
                                    </td>
                                    <td colspan="2">
                                        <div id="chatBriefDiv">
                                        </div>
                                    </td>
                                    <td class="right_con">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td class="con_m tt_left_bottom">
                                        &nbsp;
                                    </td>
                                    <td colspan="2" class="con_m">
                                        &nbsp;
                                    </td>
                                    <td class="tt_right_bottom">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td width="49%" style="vertical-align: top;">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="19px" class="xx_m">
                                        <img src="../images/xx_l.jpg" width="19" height="33" />
                                    </td>
                                    <td width="31px" class="xx_m">
                                        <img src="../images/xtxx.jpg" width="24" height="33" />
                                    </td>
                                    <td width="auto" class="xx_m">
                                        系统消息
                                    </td>
                                    <td width="19px">
                                        <img src="../images/xx_r.jpg" width="14" height="33" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="left_con">
                                    </td>
                                    <td colspan="2">
                                        <div id="letterBriefDiv">
                                        </div>
                                    </td>
                                    <td class="right_con">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td class="con_m tt_left_bottom">
                                        &nbsp;
                                    </td>
                                    <td colspan="2" class="con_m">
                                        &nbsp;
                                    </td>
                                    <td class="tt_right_bottom">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
            <%--</td>--%>
            <!--#right end-->
        </tr>
    </table>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue" EnableShadow="true">
    </telerik:RadWindowManager>
    <asp:HiddenField ID="hdnSelectTagName" Value="tagContent0" runat="server" />
    <script>
        (function () {
            var chatBrief = $("#chatBriefDiv")
                , letterBrief = $("#letterBriefDiv")
                , Users = top.Users
                , userStore = {}
                , roleStore = {
                    "88": "主管1"
                    , "101": "主管2"
                    , "110": "主管3"
                    , "42": "监理企业"
                    , "15": "施工企业"
                    , "other": "其他"
                };
            if (!Users) {
                $.get("../Message/MsgPushHandler.ashx", { Func: "GetUsers" }, function (data) {
                    if (!data) {
                        $.ligerDialog.error("用户列表获取失败！");
                    }
                    Users = data;
                    InitUser();
                }, "json");
            }
            if (!Users) return;

            InitUser();
            BindLetterBrief();

            function InitUser() {
                for (var i = 0; i < Users.length; i++) {
                    userStore[Users[i].UserGuid] = Users[i];
                }
            }

            function BindLetterBrief() {
                $.get("../Message/MsgPushHandler.ashx", { Func: "GetLetterBrief" }, function (data) {
                    if (!data) {
                        letterBrief.html("站内信获取失败.");
                    } else {
                        ShowLetterBrief(data);
                    }
                }, "json");
            }

            function ShowLetterBrief(data) {
                var html = "<table style='width:100%;'>";

                for (var i = 0, len = data.length; i < len; i++) {
                    html += "<tr>";
                    html += "<td>" + (roleStore[data[i].Receiver] || (userStore[data[i].Receiver] ? userStore[data[i].Receiver].Name : null) || roleStore["other"]) + "</td>";
                    html += "<td>&nbsp;" + data[i].SendTime + "</td>"
                    html += "<td>&nbsp;" + nodeTextToShort(data[i].MsgText) + "</td>"
                    html += "</tr>";
                }
                html += "</table>";
                letterBrief.html(html);
                $("<a href='###'>更多</a>").css({ color: "blue" }).click(function () {
                    top.addTabExtend(top.$("#siteLetterLi"), 'Message/MessageList.aspx', '站内信');
                    top.$("#chatCountor").empty();
                }).appendTo(letterBrief);
            }

            function nodeTextToShort(text, len) {
                var MAX_NODETEXT_LENGTH = len || 20;
                if (text.length > MAX_NODETEXT_LENGTH) {
                    return text.substring(0, MAX_NODETEXT_LENGTH - 1) + "...";
                }
                return text;
            }

        })()
    </script>
</asp:Content>
